package com.mustafaiev.tair.cts.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.mustafaiev.tair.cts.enums.PurchaseType;

/**
 * @author tair
 * 
 */
@Entity
@Table(name = "purchases")
public class Purchase implements ICostTrackingSystemModel {

	private static final long serialVersionUID = 6567120149089899262L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	@ManyToOne
	@JoinColumn(name = "basket_id")
	private Basket basket;

	private String title;

	private double count;

	private double cost;

	private PurchaseType type;

	@ManyToOne
	@JoinColumn(name = "owner_id", nullable = true)
	private Payer owner;

	public Long getId() {
		return this.id;
	}

	public void setId(final Long id) {
		this.id = id;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(final String title) {
		this.title = title;
	}

	public double getCount() {
		return this.count;
	}

	public void setCount(final double count) {
		this.count = count;
	}

	public double getCost() {
		return this.cost;
	}

	public void setCost(final double cost) {
		this.cost = cost;
	}

	public Basket getBasket() {
		return this.basket;
	}

	public void setBasket(final Basket basket) {
		this.basket = basket;
	}

	public PurchaseType getType() {
		return this.type;
	}

	public void setType(final PurchaseType type) {
		this.type = type;
	}

	public Payer getOwner() {
		return this.owner;
	}

	public void setOwner(final Payer owner) {
		this.owner = owner;
	}

}
